{#- 函数定义 #}
{%- if (table.regions.input_coils | length) > 0 %}
static int _{{ slave_name | string | lower }}_get_input_coils(int slave_id, int address, int len, void *outbuf)
{
{% include "c_agile_slave/c_agile_slave_get_input_coil.jinja2" %}
}
{% endif -%}

{%- if (table.regions.holding_coils | length) > 0 %}
{%- for region in table.regions.holding_coils %}
static int _{{ slave_name | string | lower }}_get_holding_coils(int slave_id, int address, int len, void *outbuf)
{
{% include "c_agile_slave/c_agile_slave_get_holding_coil.jinja2" %}
}

static int _{{ slave_name | string | lower }}_set_holding_coils(int slave_id, int address, int len, void *inbuf)
{
{% include "c_agile_slave/c_agile_slave_set_holding_coil.jinja2" %}
}
{% endfor -%}
{% endif -%}

{%- if (table.regions.input_registers | length) > 0 %}
static int _{{ slave_name | string | lower }}_get_input_registers(int slave_id, int address, int len, void *outbuf)
{
{% include "c_agile_slave/c_agile_slave_get_input_register.jinja2" %}
}
{% endif %}
{%- if (table.regions.holding_registers | length) > 0 %}
static int _{{ slave_name | string | lower }}_get_holding_registers(int slave_id, int address, int len, void *outbuf)
{
{% include "c_agile_slave/c_agile_slave_get_holding_register.jinja2" %}
}

static int _{{ slave_name | string | lower }}_set_holding_registers(int slave_id, int address, int len, void *inbuf)
{
{% include "c_agile_slave/c_agile_slave_set_holding_register.jinja2" %}
}
{% endif %}